<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<!-- #menu -->
<ul id="menu" class="bg-dark dker">
    <shiro:hasRole name="用户">
        <!-- 书籍管理 -->
        <li class="">
            <!-- 防止链接跳转 -->
            <a href="javascript:;">
                <i class="fa fa-book"></i>
                <span class="link-title">&nbsp;书籍管理</span>
                <!-- 弹出标识 -->
                <span class="fa arrow"></span>
            </a>
                <%--<ul aria-expanded="true">--%>
            <ul>
                <li>
                    <a href="${ctx}/book/create">
                        <i class="fa fa-angle-right"></i>
                        &nbsp; 新增书籍 </a>
                </li>
                <li>
                    <a href="${ctx}/book/list">
                        <i class="fa fa-angle-right"></i>
                        &nbsp; 查看 </a>
                </li>
            </ul>
        </li>

        <!-- 我的举报 -->
        <li class="hidden">
            <a href="${ctx}/report/myList">
                <i class="fa fa-pencil"></i>
          <span class="link-title">
            &nbsp;我的举报
          </span>
            </a>
        </li>

        <!-- 我的反馈 -->
        <li class="">
            <a href="${ctx}/feedback/myList">
                <i class="fa fa-pencil"></i>
          <span class="link-title">
            &nbsp;我的反馈
          </span>
            </a>
        </li>

    </shiro:hasRole>

    <shiro:hasPermission name="admin:*">
        <li class="">
            <a href="javascript:;">
                <i class="fa fa-book"></i>
                <span class="link-title">&nbsp;书籍管理</span>
            </a>
            <ul>
                <li>
                    <a href="${ctx}/book/list">
                        <i class="fa fa-angle-right"></i>
                        &nbsp; 查看 </a>
                </li>
            </ul>
        </li>

        <li class="">
            <a href="${ctx}/feedback/list">
                <i class="fa fa-pencil"></i>
          <span class="link-title">
            &nbsp;用户反馈
          </span>
            </a>
        </li>
    </shiro:hasPermission>

    <shiro:hasRole name="超级管理员">
        <li class="">
            <a href="javascript:;">
                <i class="fa fa-pencil"></i>
                  <span class="link-title">
                &nbsp;管理员相关
          </span>
                <span class="fa arrow"></span>
            </a>
            <ul>
                <li>
                    <a href="${ctx}/admin/create">
                        <i class="fa fa-angle-right"></i>
                        &nbsp; 新增管理员 </a>
                </li>
                <li>
                    <a href="${ctx}/admin/list">
                        <i class="fa fa-angle-right"></i>
                        &nbsp; 查看 </a>
                </li>
            </ul>
        </li>
    </shiro:hasRole>

    <!-- 系统消息 -->
    <li class="">
        <!-- 防止链接跳转 -->
        <a href="${ctx}/message/index">
            <i class="fa fa-envelope "></i>
            <span class="link-title">&nbsp;系统消息</span>
            <span id="menuMessage" class="badge" style="top:0px"><c:if test="${messageCnt!=null && messageCnt > 0}">${messageCnt}</c:if></span>
        </a>
    </li>

    <!-- 个人信息 -->
    <li class="">
        <a href="${ctx}/profile/update">
            <i class="fa fa-pencil"></i>
              <span class="link-title">
                &nbsp;个人信息
              </span>
            <%--<span class="fa arrow"></span>--%>
        </a>
    </li>

    <!-- 修改密码 -->
    <li class="">
        <a href="javascript:;">
            <i class="fa fa-pencil"></i>
                  <span class="link-title">
                &nbsp;账号相关
          </span>
            <span class="fa arrow"></span>
        </a>
        <ul>
            <li>
                <a href="${ctx}/updatePassword">
                    <i class="fa fa-angle-right"></i>
                    &nbsp; 修改密码 </a>
            </li>
        </ul>
    </li>
</ul><!-- /#menu -->
